package com.cakemallproject.mapper;

import com.cakemallproject.pojo.mapperObj.OrderItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderItemMapper {
    @Select("select * from orderitem where status != 0")
    List<OrderItem> list();

    @Insert("insert orderitem(oid, gid, price, num) values(#{oid},#{gid},#{price},#{num}) ")
    void insert(OrderItem orderItem);

    @Select("select * from orderitem where status != 0 and oid = #{oid} ")
    List<OrderItem> getByOid(Integer oid);
}
